<?php
    include __DIR__.'/function.php';
    require __DIR__.'/vendor/autoload.php';
    use QL\QueryList;
    //
    $url = 'https://news.ke.com/bj/baike/0033/';
    $html = http_request($url);
    //采集某页面上的所有的图片
    // $data = QueryList::get($url)->find('img')->attr('src');
    //打印结果
    // $ql = QueryList::get($url);
    $rules = [
        'title'=>['.text .LOGCLICK','text'],
        'img' => ['.lj-lazy','data-original'],
        'desc' => ['.text .summary','text'],
        'time' => ['.info .time','text']
    ];
    //切片选择器
    $range = '.m-col .item';
    $rt = QueryList::get($url)->rules($rules)->range($range)->query()->getData();
    var_dump($rt->all());
?>